If you are using Terraform to deploy the infrastructure in AWS and if it includes auto scaling groups and policies set on EC2 machines and ECS services,you have to prevent resetting the Desired Count of the scaled up services on every IAC deployment.
Consequence
If no action is taken,it would be disastrous in the Production environment for the service which is up and running on full capacity.Deploying your Terraform updates would abruptly bring down the service count to initial capacity mentioned in the scripts.
Prevention
To prevent above scenario we need to use the Terraform argument lifecycle with ignore_changes set as shown in below example.
For ECS Service
For EC2 Auto Scaling Group
Conclusion
With the lifecycle set as above,we could prevent deployments overriding the running count and it also allows to tweak the scaling count out of our IAC pipeline.